<?php $batchSession = ''; ?>
<div id="venue_count<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>">
    <div class="batch-second">
        <div class="details-collapse clearfix" >
            <h3><span>batch <span class="createdVenueBatchCount create_venue_<?php echo $venueIndex; ?>_batchcounter" id="create_venue_<?php echo $venueIndex; ?>_batch_counter_<?php echo $batchIndex; ?>"><?php echo $batchIndex + 1; ?></span></span> <span class="buttom-exp pull-right"><em class="sprite dw-arrow"></em></span> </h3>
        </div>
        <div class="uncollapse clearfix" style="display: none;">
            <div class="col-lg-4 col-md-4 col-sm-4 column4 course-pdl">
                <?php echo $form->labelEx($model, 'start_date'); ?> 
                <input type="hidden" name="batchIndex[<?php echo $venueIndex; ?>][]" value="<?php echo $batchIndex; ?>">
                <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][start_date][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_start_date_<?php echo $batchIndex; ?>" type="text" class="requiredfield hasDatepicker span2 form-control book-control" onblur="checkValueEmpty(this.id)" onkeyup="hasDatepicker(this.id)" onclick="hasDatepicker(this.id)" onpaste="return false;" value="<?php echo $venueWithBatch[$batchIndex]->start_date; ?>">
                <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_start_date_<?php echo $batchIndex; ?>" style="display:none">Start date cannot be blank.</div>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 column4">
                <?php echo $form->labelEx($model, 'start_time'); ?>
                <div class="input-append bootstrap-timepicker time-sin">
                    <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][start_time][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_start_time_<?php echo $batchIndex; ?>" type="text" class="requiredfield hastimePicker add-on book-control time-sin" onpaste="return false;" onkeyup="hastimePicker(this.id);" onclick="hastimePicker(this.id);" onchange="timeCheck(this.id);" value="<?php echo $venueWithBatch[$batchIndex]->start_time; ?>">
                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_start_time_<?php echo $batchIndex; ?>" style="display:none">Start time cannot be blank.</div></div>
            </div>

            <div class="col-lg-4 col-md-4 col-sm-4 course-pdr column4">
                <?php echo $form->labelEx($model, 'end_time'); ?>
                <div class="input-append bootstrap-timepicker time-sin">
                    <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][end_time][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>" type="text" class="hastimePicker requiredfield  add-on book-control time-sin" onpaste="return false;" onkeyup="hastimePicker(this.id);" onclick="hastimePicker(this.id);" onchange="timeCheck(this.id);"  value="<?php echo $venueWithBatch[$batchIndex]->end_time; ?>">
                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>" style="display:none">End time cannot be blank.</div>
                    <div class="errorMessage" id="endTime_class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>"></div></div>
            </div>
            <div class="clearfix"></div>
            <div class="col-lg-5 col-md-5 col-sm-5 column5 course-pdl">
                <?php echo $form->labelEx($model, 'price'); ?>
                <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][price][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_price_<?php echo $batchIndex; ?>" type="text" onkeypress="return isNumberKey(event)" onblur="checkValueEmpty(this.id)" class="requiredfield form-control book-control" value="<?php echo $venueWithBatch[$batchIndex]->price; ?>">
                <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_price_<?php echo $batchIndex; ?>" style="display:none">Price cannot be blank.</div>
            </div>
            <div class="col-lg-5 column5 col-lg-offset-2 col-md-4 col-md-offset-2 col-sm-5 course-pdr">
                <?php echo $form->labelEx($model, 'seats'); ?>
                <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][seats][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_seats_<?php echo $batchIndex; ?>" type="text" onblur="checkValueEmpty(this.id)" onkeypress="return isNumberKey(event)" class="requiredfield form-control book-control" value="<?php echo $venueWithBatch[$batchIndex]->seats; ?>">
                <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_seats_<?php echo $batchIndex; ?>" style="display:none">Seats cannot be blank.</div>
            </div>
            <div class="batch-disc">
                <h4>Batch discounts:</h4>
                <?php /* .......................          Here is the early discount code start................ */ ?>
                <?php
                $this->renderPartial('/classEarlyDiscount/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                    'venueIndex' => $venueIndex,
                    'batchId' => $venueWithBatch[$batchIndex]->id));
                ?> 
                <?php /* .......................          Here is the early discount code end................ */ ?>
                <?php /* .......................          Here is the group discount code start................ */ ?>

                <?php
                $this->renderPartial('/groupDiscount/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                    'venueIndex' => $venueIndex,
                    'batchId' => $venueWithBatch[$batchIndex]->id));
                ?> 


                <?php /* .......................          Here is the group discount code end ................ */ ?>
                <?php /* .......................          Here is the custome session code start................ */ ?>
                <div class="form-group">
                    <div class="col-lg-3 col-md-3 col-sm-3 column3 course-pdl">
                        <label for="add-session">Add session:</label>
                        <?php echo CHtml::dropDownList('ClassBatch[ClassVenue][' . $venueIndex . '][schedule_id][]', $venueWithBatch[$batchIndex]->schedule_id, getAllSchedule('class'), array('class' => 'form-control book-control getschedule_venue_' . $venueIndex . '_batch_' . $batchIndex . '', 'id' => 'addvenue_' . $venueIndex . '_batch_' . $batchIndex . '_schedule_id_0', 'onchange' => 'addCustomeSchedule(this.id);')); ?>
                        <span class="class-arrow1"></span></div>
                    <div class="clearfix gap"></div>                       
                    <div id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule">                                            
                        <?php
                        $sessionIndex = '';
                        if ($venueWithBatch[$batchIndex]->schedule_id == 4) {
                            $batchSession = BatcheSession::model()->findAllByAttributes(array('batche_id' => $venueWithBatch[$batchIndex]->id));
                            for ($sessionIndex = 0; $sessionIndex < count($batchSession); $sessionIndex++) {
                                $this->renderPartial('/batcheSession/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                                    'venueIndex' => $venueIndex, 'batchSession' => $batchSession, 'sessionIndex' => $sessionIndex));
                            }
                        }
                        ?>                                            
                    </div>
                    <div class="showSession_venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule" style="clear: both; display: <?php echo ($batchSession == '') ? 'none' : ''; ?>;"><p class="alignL remmarginB"><a href="javascript:void(0)" id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule_id_<?php echo ($sessionIndex == '') ? '0' : $sessionIndex - 1; ?>" onclick="addCustomeSchedule(this.id);">Add Session </a></p></div>

                </div> 
                <?php /* .......................         Here is the custome session code end................ */ ?>

                <?php /* .......................         Here is the custome session code end................ */ ?>
            </div>
            <div class="class-struct">
                <h4>class structure:</h4> 
                <?php
                $class = '';
                $this->renderPartial('//classStructures/updateClassStructure', array('form' => $form, 'batchIndex' => $batchIndex,
                    'venueIndex' => $venueIndex,
                    'type' => $class,
                    'classId' => $venueWithBatch[$batchIndex]->classes_id,
                    'batchId' => $venueWithBatch[$batchIndex]->id));
                ?> 
            </div>
            <?php /* .......................         Here is the class structure code end................ */ ?>
            <?php if ($batchIndex != 0) { ?> <div class="row batch-row adding-el">
                    <div class="col-lg-12 column12 course-pdr">
                        <a href="javascript:void(0)" id="venue_remove_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>" onclick="reMoveBatch(this.id);">-Remove Batch</a>

                    </div>
                </div> <?php } ?>
        </div>
    </div>
</div>